import { Space, Table, Tag } from 'antd';
import React from 'react';
import {useState,useEffect} from "react"
import axios from "../utils/axios"


const App = () =>{
    let [arr,setArr] = useState([])
   let [columns,setcolumes] = useState([
    {
      title: 'name',
      dataIndex: 'type',
      key: 'name',
      render: (text) => <a>{text}</a>,
    },
  
 
    {
      title: 'Action',
      key: 'action',
      render: (_, record) => (
        <Space size="middle">
          <a>Invite {record.name}</a>
          <a>Delete</a>
        </Space>
      ),
    },
  ])
  useEffect(()=>{
    axios.get("/list").then(res=>{
        setArr(res.data)
    })
},[])


  return <Table columns={columns} dataSource={arr} />;} 

export default App;